package com.qiaoan.myenum;

/**
 * Created by zhangchong on 2017/4/26.
 */
public enum Enable {

    /**
     * 禁用(0)
     */
    True {
        @Override
        public Integer getCode() {
            return 1;
        }
    },

    /**
     * 启用(1)
     */
    False {
        @Override
        public Integer getCode() {
            return 2;
        }
    };


    @Override
    public String toString() {
        return this.getCode().toString();
    }

    public abstract Integer getCode();

    public int getValue() {
        return this.ordinal();
    }

}
